from lxml import etree
from script.get_user_info.response.ncstoj_response import ncst_response
# 获取 codeforces用户的 rating
def ncst_rating(uid):
    response = ncst_response(uid)
    html = etree.HTML(response)
    rating_cp = html.xpath('//p[contains(text(), "解决了")]/text()')
    return rating_cp[0].split('RP: ')[1].split(' (No.')[0]

if __name__ == '__main__':
    print(ncst_rating("1358"))
